/*
 * FlatNet.java
 *
 * 
 */

package it.luigiarpino.alt2jsim.network;


/**
 *
 * @author  Luigi Lorenzo Arpino 534/559
 */
public class FlatNet extends it.luigiarpino.alt2jsim.network.Net {
    
    /** Creates a new instance of FlatNet */
    public FlatNet(int numOfNode_,int numOfArch_,int scale_, String[] nomiNodi_,int [][] archi_,int[][] posizioneNodi_) {
        super(numOfNode_, numOfArch_, scale_,  nomiNodi_, archi_,posizioneNodi_);
    }
    
    
    public int[][] getFlatMatrix(){
        int[][] matrix=new int[this.numOfNode][this.numOfNode];
        for(int i=0;i<this.numOfNode;i++){
            for(int j=0;j<this.numOfNode;j++){
                matrix[i][j]=0;
            }
        }
        for(int i=0;i<this.numOfArch;i++){
            matrix[this.archi[i][0]][this.archi[i][1]]++;
        }
        for(int i=0;i<this.numOfNode;i++){
            matrix[i][i]=0;
        }
        return matrix;
    }
    
    
    public String getInfo(){
        String stringa=new String();
        stringa="<HTML>Flat network<BR>";
        stringa=stringa+"Numbers of nodes "+this.numOfNode+"<BR>";
        stringa=stringa+"Numbers of links "+this.numOfArch+"<BR>";
        stringa=stringa+"Grid size "+this.scale+" x "+this.scale+"<BR>";
        stringa=stringa+"</HTML>";
        return stringa;
    }
    
    
}
